(function(){"use strict";BX.namespace("BX.Fileman.Google");BX.Fileman.Google.GeoCoder=function(){this.geocoder=null};BX.Fileman.Google.GeoCoder.prototype.search=function(e,o){if(e!==""){BX.Fileman.Google.Loader.init(BX.delegate(function(){this.runSearch(e,o)},this))}};BX.Fileman.Google.GeoCoder.prototype.runSearch=function(e,o){if(this.geocoder===null){this.geocoder=new google.maps.Geocoder}var t={language:BX.message("LANGUAGE_ID")};if(BX.type.isArray(e)){t.latLng=BX.Fileman.Google.getGoogleLatLng(e)}else{t.placeId=e}this.geocoder.geocode(t,BX.delegate(this.processResult(o),this))};BX.Fileman.Google.GeoCoder.prototype.processResult=function(e){return function(o,t){var r=[];if(t!==google.maps.GeocoderStatus.OK&&t!==google.maps.GeocoderStatus.ZERO_RESULTS){this.throwError(t)}else{for(var n=0;n<o.length;n++){r.push({text:o[n].formatted_address,components:o[n].address_components,coords:[o[n].geometry.location.lat(),o[n].geometry.location.lng()],viewport:[[o[n].geometry.viewport.getNorthEast().lat(),o[n].geometry.viewport.getNorthEast().lng()],[o[n].geometry.viewport.getSouthWest().lat(),o[n].geometry.viewport.getSouthWest().lng()]]})}}e(r)}};BX.Fileman.Google.GeoCoder.prototype.throwError=function(e){console.error("BX.Fileman.Google.GeoCoder: "+e?e.message:"Google error!")}})();